/*
 * @Author: szx
 * @Date: 2022-01-05 13:23:44
 * @LastEditTime: 2022-01-05 13:32:40
 * @Description:
 * @FilePath: \leetcode\400-499\452\452.js
 */
/**
 * @param {number[][]} points
 * @return {number}
 */
var findMinArrowShots = function (points) {
    points.sort((a, b) => a[0] - b[0]);
    let res = 1;
    for (let i = 1; i < points.length; i++) {
        if (points[i][0] > points[i - 1][1]) {
            res++;
        } else {
            points[i][1] = Math.min(points[i][1], points[i - 1][1]);
        }
    }
    return res;
};
